/* 
 * File:   structs.h
 * Author: Dwarf
 *
 * Created on 26. září 2011, 22:14
 */

#ifndef STRUCTS_H
#define	STRUCTS_H

#define MSG_WORK_REQUEST 1000
#define MSG_WORK_SENT    1001
#define MSG_WORK_NOWORK  1002
#define MSG_TOKEN        1003
#define MSG_FINISH       1004
#define MSG_INIT         1005
#define MSG_INIT_DATA    1006
#define MSG_DATA_HEADER  1007
#define MSG_DATA         1008
#define MSG_BOUND_UPDATE 1009
#define MSG_SOLUTION     1010

#define TOKEN_WHITE      1500
#define TOKEN_BLACK      1501

#include <vector>
#include "mpi.h"

using namespace std;

struct Move {
    int Disc;
    int from;
    int to;
    int turn;
};

struct Token {
    int status;
    int from;    
};

class Stack2 {
public:
    Stack2(int);
    void Push(Move*);
    Move* Top();
    void Pop();
    bool isEmpty();
    int getSize();
    void printStack(ofstream&);
    void split(vector<Move>*,ofstream&);
    void del();
    
private:
    int size;
    Move* top;
    int maxsize;
};


class Comm {
public:
    static void send(vector<Move>*,int,ofstream&);
    static void recieve(vector<Move>*,int,ofstream&);
    
};


#endif	/* STRUCTS_H */

